﻿using System.Text;
using AntaresShell.BaseClasses;

namespace Repository.MODELs
{
    public class UserModel : SearchableBaseModel
    {
        public UserModel()
        {

        }

        public UserModel(UserModel target)
        {
            UserID = target.UserID;
            Username = target.Username;
            Phone = target.Phone;
            Email = target.Email;
            DOB = target.DOB;
        }

        private int _userID;
        public int UserID
        {
            get
            {
                return _userID;
            }
            set
            {
                SetProperty(ref _userID, value);
            }
        }

        private string _userName;
        public string Username
        {
            get
            {
                return _userName;
            }
            set
            {
                SetProperty(ref _userName, value);
                Name = value;
            }
        }

        private string _phone;
        public string Phone
        {
            get
            {
                return _phone;
            }
            set
            {
                SetProperty(ref _phone, value);
                Description = value;
            }
        }

        private string _email;
        public string Email { get { return _email; } set { SetProperty(ref _email, value); } }

        private string _dob;
        public string DOB { get { return _dob; } set { SetProperty(ref _dob, value); } }

        public override string ToSearchableString()
        {
            return new StringBuilder().Append(Username).Append("|").Append(Phone).Append("|").Append(Email).Append("|").Append(DOB).ToString();
        }
    }
}
